{include file="public/header"/}
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>日志列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <div class="row">
                <div class="col-sm-12">
                    <form name="admin_list_sea" class="form-search" method="post" action="{:url('index')}">
                        <div class="col-sm-3">
                            <div class="input-group">
                                 {php}$admin_id = isset($admin_id) ? $admin_id : ""{/php}
                                 <select class="form-control m-b chosen-select" name="admin_id" id='admin_id'>
                                    <option value="0">选择管理员</option>
                                    {foreach $adminList as $admin}
                                        <option value="{$admin['id']}" {if condition="$admin_id eq $admin['id']"}selected="selected"{/if}>{$admin["username"]}</option>
                                    {/foreach}
                                </select>
                                <span class="input-group-btn"> 
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button> 
                                </span>
                            </div>
                        </div>
                    </form>                         
                </div>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th width="5%">ID</th>
                                <th width="5%">用户ID</th>
                                <th width="5%">操作用户</th>
                                <th width="15%">描述</th>
                                <th width="8%">操作IP</th>
                                <th width="10%">地址</th>
                                <th width="6%">状态</th>
                                <th width="10%">操作时间</th>
                                <th width="8%">操作</th>
                            </tr>
                        </thead>
                        <tbody id="list-content">
                            {foreach $list as $vo}
                                <tr class="long-td">
                                    <td>{$vo["log_id"]}</td>
                                    <td>{$vo["admin_id"]}</td>
                                    <td>{$vo["admin_name"]}</td>
                                    <td>{$vo["description"]}</td>
                                    <td>{$vo["ip"]}</td>
                                    <td>{$vo["ip_addr"]["country"]}{$vo["ip_addr"]["area"]}</td>
                                    <td>
                                        {if condition="$vo['status'] eq 1"}
                                            操作成功
                                        {else /}
                                            <span style="color: red">操作失败<span>
                                        {/if}
                                    </td>
                                    <td>{$vo["add_time"]}</td>
                                    <td>
                                        <a href="{:url('delete',['id'=>$vo['log_id']])}" class="btn btn-danger btn-xs">
                                            <i class="fa fa-trash-o"></i> 删除
                                        </a>
                                    </td>
                                </tr>
                            {/foreach}
                        </tbody>
                    </table>
                    {$list->render()}
                </div>
            </div>
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

{include file="public/footer" /}

</body>
</html>